/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.anote;

import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.anote.ui.TrayMenu;
import org.tools.ui.helper.LookAndFeel;

/**
 *
 * @author Trilarion 2012
 */
public class Main {

    /** */
    private static final Logger LOG = Logger.getLogger(Main.class.getName());

    /** Private constructor to avoid instantiation. */
    private Main() {}

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        setupLogger();

        // set system look and feel (we might need it already in the choose language dialog)
        LookAndFeel.setSystemLookAndFeel();

        // setup the tray menu
        TrayMenu.start();

    }

    private static void setupLogger() {
        // setup of the logger
        Handler handler = null;
        handler = new ConsoleHandler();
        handler.setFormatter(new SimpleFormatter());
        handler.setLevel(Level.INFO);
        Logger.getLogger("").addHandler(handler);

        // our first log message (just to get the date and time)
        LOG.log(Level.INFO, "A Note starting");
    }

    public static void ShutDown() {
        System.exit(0);
    }
}
